import express from 'express'
import roleController from '@/controllers/roleController'

const router = express.Router()

/**
 * 查询角色列表
 * GET /roles
 */
router.get('/', roleController.getRoles)

/**
 * 查询角色详情
 * GET /roles/:id
 */
router.get('/:id', roleController.getRoleInfo)

/**
 * 添加角色
 * POST /roles
 */
router.post('/', roleController.addRole)

/**
 * 添加角色
 * PUT /roles/:id
 */
router.put('/:id', roleController.updateRole)

/**
 * 删除角色
 * DELETE /roles/:id
 */
router.delete('/:id', roleController.deleteRole)

export default router
